import request from '@/utils/request'

export function commitPage(params) {
  return request({
    url: '/commit/page',
    method: 'POST',
    data: params,
  })
}

export function getPowerList(userId) {
  return request({
    url: '/commit/power?userId=' + userId,
    method: 'GET',
  })
}

export function saveCommit(problemId, language, code) {
  return request({
    url: '/commit',
    method: 'POST',
    data: {
      problemId: problemId,
      language: language,
      code: code
    }
  })
}

export function debugCode(problemId, language, code, debugCase) {
  return request({
    url: '/commit/debug',
    method: 'POST',
    data: {
      problemId: problemId,
      language: language,
      code: code,
      debugCase: debugCase,
    }
  })
}

